package com.yeung.exam;

import java.util.Scanner;

public class 三个线程1 {
    private static volatile String result;

    public static void main(String[] args) throws InterruptedException {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        result = line;
        Thread tha = new Thread(new Work("_A"));
        tha.start();
        tha.join();
        Thread thb = new Thread(new Work("_B"));
        thb.start();
        thb.join();
        Thread thc = new Thread(new Work("_C"));
        thc.start();
        Thread.sleep(10);
        System.out.println(result);

    }

    static class Work implements Runnable {
        private String suf;

        @Override
        public void run() {
            result = result + suf;
        }

        public Work(String suf) {
            this.suf = suf;
        }
    }

}
